#include <stdio.h>


int isPrime(int number) {

  for (int i = 2; i * i <= number; i++) {
    if (number % i == 0)
      return 0;
  }

  return 1;
}


int main(int argc, char *argv[]) {

  int limit;
  int base = 2;
  int count = 0;

  scanf("%d", &limit);

  while (base + 2 <= limit) {
    if (isPrime(base) && isPrime(base + 2))
      count++;
    base++;
  }

  printf("%d\n", count);

  return 0;
}
